package com.hzw.saas.web.hbox.dto;

import java.io.Serializable;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.hzw.saas.api.storage.enums.FileIntegrityEnum;
import com.hzw.saas.api.storage.enums.ResourceStatusEnum;
import com.hzw.saas.common.util.constants.PatternConsts;
import org.springframework.format.annotation.DateTimeFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * 文件信息业务对象
 *
 * @author zzl
 * @since 02/19/2021
 */
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "HBox文件信息", description = "HBox文件信息")
public class HBoxFileDTO implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 文件ID
     */
    @ApiModelProperty(value = "文件ID", position = 1)
    private String fileId;

    /**
     * 文件所在目录ID，根目录ID为0
     */
    @ApiModelProperty(value = "文件所在目录ID，根目录ID为0", position = 2)
    private String folderId;

    /**
     * 文件完整名称，含后缀
     */
    @ApiModelProperty(value = "文件完整名称，含后缀", position = 3)
    private String name;

    /**
     * 文件后缀
     */
    @ApiModelProperty(value = "文件后缀", position = 4)
    private String suffix;

    /**
     * 文件长度，单位：byte
     */
    @ApiModelProperty(value = "文件长度，单位：byte", position = 5)
    private Long length;

    /**
     * 文件摘要，MD5
     */
    @ApiModelProperty(value = "文件摘要，MD5", position = 6)
    private String digest;

    /**
     * 文件完整性
     */
    @ApiModelProperty(value = "文件完整性, " + FileIntegrityEnum.API_TEXT, position = 7)
    private Integer integrity;

    /**
     * 文件状态
     */
    @ApiModelProperty(value = "文件状态, " + ResourceStatusEnum.API_TEXT, position = 8)
    private Integer status;

    /**
     * 创建者ID
     */
    @ApiModelProperty(value = "文件创建者ID", position = 10)
    private String creatorId;

    /**
     * 创建者名称
     */
    @ApiModelProperty(value = "创建者名称", position = 11)
    private String creatorName;

    /**
     * 所有者ID（用户或共享空间）
     */
    @ApiModelProperty(value = "文件所有者ID", position = 12)
    private String ownerId;

    /**
     * 所有者名称
     */
    @ApiModelProperty(value = "所有者名称", position = 13)
    private String ownerName;

    /**
     * 创建时间
     */
    @ApiModelProperty(value = "文件创建时间, format=" + PatternConsts.NORM_DATETIME_PATTERN, position = 14)
    @DateTimeFormat(pattern = PatternConsts.NORM_DATETIME_PATTERN)
    @JsonFormat(pattern = PatternConsts.NORM_DATETIME_PATTERN)
    private Date createDate;

    /**
     * 更新时间
     */
    @ApiModelProperty(value = "文件更新时间, format=" + PatternConsts.NORM_DATETIME_PATTERN, position = 15)
    @DateTimeFormat(pattern = PatternConsts.NORM_DATETIME_PATTERN)
    @JsonFormat(pattern = PatternConsts.NORM_DATETIME_PATTERN)
    private Date updateDate;
}
